<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
export default {
  mixins: [
    Vue.prototype.$vFN.Mixins.Base,
    Vue.prototype.$vFN.Mixins.Edit,
    Vue.prototype.$vFN.Mixins.List,
  ],
  components: {
    SelectDataGoods: async () =>
      Vue.extend(await Vue.prototype.$vFN.Components.Base.SelectDataGoods()),
  },
  data() {
    return {
      appWindow: window,
      subListNum: {},
      // 页面接口地址
      apiUrl: {
        create: "plugin/team-dividend/admin/member/list",
        update: "plugin/team-dividend/admin/member/subList",
        detail: "plugin/team-dividend/admin/member/destroy",
        list: "plugin/team-dividend/admin/member/subList"
      },
      loading: true,
      // dealer查询经销商 member查询普通 不传：都查
      subModule: "member",

      // 请求携带参数
      mixinList_tableSearchConst: {
        member_id: "",
        subModule: "member",
      },

      // 表格数据删除展示结构
      tableDeleteConfig: {
        width: "400px",
        title: "确定删除?",
        columns: [
          {
            label: "商品名称",
            prop: "productName",
            type: "",
          },
        ],
      },
    };
  },
  methods: {
    subList() {
      this.mixinList_tableSearchConst.subModule = this.subModule;
      this.mixinList_refreshData();
    },
    // 队长列表：基本资料、查看
    async dealerInfo() {
      let res = await this.$vFN.Http.post({
          url: "plugin/team-dividend/admin/member/dealerInfo",
          data: {
              member_id: this.id,
          }
      }, window); 
      console.log(res.data);
    },
    async subListStatus() {
      let res = await this.$vFN.Http.post({
          url: "plugin/team-dividend/admin/member/subListStatistic",
          data: {
              member_id: this.id,
          }
      }, window); 
      this.subListNum = res.data;
    },
    // 初始化
    async init() {
      // this.subList();
      this.subListStatus();
      this.dealerInfo();
      // 显示窗口
      // this.getList();
      this.mixinList_getTable();
      this.mixinEdit_editVisible = true;
    },

    // 提交成功
    onSubmitSuccess() {
      this.onSuccess();
    },
    // 成功回调
    onSuccess() {},
    // 取消回调
    onCancel() {},
    // 失败回调
    onError() {},
  },
  mounted() {
    this.mixinList_tableSearchConst.member_id = this.id;
    this.mixinList_tableSearchConst.subModule = this.subModule;
    this.init();
  },
  activated() {},
};
</script>